import sun.awt.windows.ThemeReader;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-12-05
 * Time:10:10
 */
public class Test {
    public static void main1(String[] args) {
        Thread t=new Thread(new Runnable() {
            @Override
            public void run() {
                while(!Thread.currentThread().isInterrupted()){
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                        break;
                    }
                    System.out.println("haha");
                }
            }
        });
        t.start();
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        t.interrupt();
    }

    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        long []arr=new long[3*n];
        int i=0;
        while(scanner.hasNext()){
            arr[i++]=scanner.nextInt();
        }
        Arrays.sort(arr);
        long sum=0;
        for (int j = 0; j < n; j++) {
            sum+=arr[arr.length-2*(j+1)];
        }
        System.out.println(sum);
    }

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String s1= scanner.nextLine();
        String s2=scanner.nextLine();
        HashMap<Character,Integer> hashMap=new HashMap<>();
        for (int i = 0; i < s2.length(); i++) {
            char str=s2.charAt(i);
            if(hashMap.containsKey(str)){
                hashMap.put(str, hashMap.get(str)+1);
            }else{
                hashMap.put(str,1);
            }
        }
        StringBuilder ret= new StringBuilder();
        for (int i = 0; i < s1.length(); i++) {
            char c=s1.charAt(i);
            if(!hashMap.containsKey(c)){
                ret.append(c);
            }
        }
        System.out.println(ret);
    }
}
